package com.nuoniu.sibanyun.service.production.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nuoniu.sibanyun.entity.production.VProductionPickReturnDetail;
import com.nuoniu.sibanyun.mapper.production.VProductionPickReturnDetailMapper;
import com.nuoniu.sibanyun.service.production.IVProductionPickReturnDetailService;
import com.nuoniu.sibanyun.userThread.UserInfo;
import com.nuoniu.sibanyun.userThread.UserThreadLocal;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 生产领退补料单明细 服务实现类
 * </p>
 *
 * @author 小啊刚
 * @since 2021-01-15
 */
@Service
public class VProductionPickReturnDetailServiceImpl extends ServiceImpl<VProductionPickReturnDetailMapper, VProductionPickReturnDetail> implements IVProductionPickReturnDetailService {

    @Override
    public List<VProductionPickReturnDetail> getSimpleDetailsByOrderId(Long orderId) {
        UserInfo userInfo = UserThreadLocal.get();
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.select("id","company_id","order_id","inventory_id","inventory_name","inventory_code","base_unit","base_unit_name","base_quantity");
        queryWrapper.eq("company_id",userInfo.getCompanyId());
        queryWrapper.eq("order_id",orderId);
        List<VProductionPickReturnDetail> list = list(queryWrapper);
        return list;
    }
}
